﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Mapeo;
using System.Data;
using NHibernate;
using MySql.Data.MySqlClient;

namespace DAL
{
    public class ReporteCerfificadoEstudios_DAL:Controlador
    {

        public DataTable ObtenerCertificadoAlumno(String CodigoAlumno, String CodigoEspecialidad)
        {
            using (ISession Sesion = m_SessionFactory.OpenSession())
            {
                using (ITransaction Trans = Sesion.BeginTransaction())
                {
                    MySqlCommand SqlCmd = new MySqlCommand();
                    SqlCmd.Connection = (MySqlConnection)Sesion.Connection;
                    Trans.Enlist(SqlCmd);
                    SqlCmd.CommandText = "sp_CertificadoEstudiosAlumno";
                    SqlCmd.CommandType = System.Data.CommandType.StoredProcedure;
                    SqlCmd.Parameters.AddWithValue("@in_CodigoAlumno", CodigoAlumno);
                    SqlCmd.Parameters.AddWithValue("@in_Especialidad", CodigoEspecialidad);
                    SqlCmd.ExecuteNonQuery();
                    MySqlDataAdapter da = new MySqlDataAdapter(SqlCmd);
                    DataTable dt = new DataTable();
                    da.Fill(dt);
                    Trans.Commit();
                    return dt;
                }
            }

        }


    }
}
